<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    function fun(a, ins) {
        if (isNaN(ins)) {
            return "你不是个数"
        } else {
            var number = parseInt(ins)
            a.push(number)
            a.sort(function (a, b) {
                return a - b
            })
            return a
        }
    }
    console.log(fun([20, 1, 2, 3, 65, 12, 56, 12, 21, 51, 50, 49], 50))
</script>

</html>